<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<div><spring:message code="console.webapp.label.comment"/></div>
<form:form modelAttribute="comment">
    <form:hidden path="id"/>
    <form:hidden path="createdDate"/>
    <form:hidden path="lastUpdateDate"/>
    <table>
        <tr>
            <td><spring:message code="console.webapp.label.title"/></td>
            <td><form:input path="title"/> <form:errors path="title"/></td>
        </tr>
        <tr>
            <td><spring:message code="console.webapp.label.content"/></td>
            <td><form:textarea path="content"/> <form:errors path="content"/></td>
        </tr>
        <tr>
            <td><spring:message code="console.webapp.label.books"/></td>
            <td><form:select path="book" items="${allBooks}" itemValue="id" itemLabel="title"/></td>
        </tr>
        <tr>
            <td><spring:message code="console.webapp.label.readers"/></td>
            <td><form:select path="reader" items="${allReaders}" itemLabel="fullName" itemValue="id"/></td>
        </tr>
        <tr>
            <td><input type="reset"/></td>
            <td><input type="submit"/></td>
        </tr>
    </table>
</form:form>